<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>账户余额查询</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
    <!-- 当前页面样式 END -->
    <script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type="text/javascript">		
		function queryCheck(){
			$("#queryAcctForm").attr("action","<%=basePath%>accountBalance/queryAcctBalance.ct")
			$("#queryAcctForm").submit();
			$("#queryBtnId").attr("disabled","true");
			$("#adds").attr("disabled","true");
			$("#updates").attr("disabled","true");
		} 
		//初始化页面
		function addAcct(){
			$("#queryAcctForm").attr("action","<%=basePath%>accountBalance/addAcctBalanceinit.ct")
			$("#queryAcctForm").submit();
			$("#queryBtnId").attr("disabled","true");
			$("#adds").attr("disabled","true");
			$("#updates").attr("disabled","true");
		}
		
		function updateAcct(){
			var dd = $("input[name=multiSel]:checked");
			if(dd.length!=1){
				alert("请选择一条记录!");
				return;
			}
			var index=dd.val();
			var timestamp = Date.parse(new Date())/1000;
			var url="<%=basePath%>accountBalance/updateAcctBalanceinit.ct?_t="+timestamp+"&acctBalKey="+index;
			$("#queryAcctForm").attr("action",url)
			$("#queryAcctForm").submit();
			$("#queryBtnId").attr("disabled","true");
			$("#adds").attr("disabled","true");
			$("#updates").attr("disabled","true");
		}
	</script>
</head>
<body>
<s:form id="queryAcctForm" action="/accountBalance/queryAcctBalance.ct" method="post" theme="simple">
<table class="tb">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">账户余额查询</div></td>
        </tr>
		<tr class="tb-line">
            
            <td align="right" class="tb-td">
                <div class="tb-h4">日期：</div>
            </td>
            <td class="tb-td">
                 <label class="tb-input-mini">
                <s:textfield id="currentDate" name="searchCondition.currentDate" placeholder="日期" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" cssClass="queryWidth"></s:textfield>
                </label>
            </td>
            
            <td align="right" class="tb-td">
                <div class="tb-h4">账号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                <s:textfield name="searchCondition.account" cssClass="queryWidth"></s:textfield>
                </label>
            </td>
        </tr>		
        <tr class="tb-line">
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">机构名称：</div>
            </td>
            <td class="tb-td">
 				<label class="tb-select">
 				<s:select name="searchCondition.org" list="orgList" listKey="InsIdCd" listValue="InsName" headerKey="" headerValue="请选择" cssClass="queryWidth"/>
                </label>
 			</td>
			<td align="right" class="tb-td">
                <div class="tb-h4">状态：</div>
            </td>
            <td class="tb-td">
                <label class="tb-select">
				 <s:select name="searchCondition.status" list="#{'00':'正常','01':'冻结'}" headerKey="" headerValue="不限" cssClass="queryWidth" id="status"/> 
                </label>
            </td>
            
        </tr>
        <tr class="tb-line">
						<td colspan="4" align="center"><span style="color: red"><s:actionerror /></span>
							<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
		</tr>
        
        <tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
                    <input id="queryBtnId" type="button" value="查询" onclick="queryCheck()"/>
                </label>
                <label class="tb-input-submit">
                    <input type="reset" value="取消"/>
                </label>
                <label class="tb-input-submit">
                	 <input id="adds" type="button" value="添加" onclick="addAcct()"/>
                </label>
                
                 <label class="tb-input-submit">
                	 <input id="updates" type="button" value="修改" onclick="updateAcct()"/>
                </label>
            </td>
        </tr>
        <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
			<tr class="tb-line">
				<td class="tb-td paging"  align="left" colspan="4"> <page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/accountBalance/queryAcctBalance.ct?currentPage=" />

				</td>
			</tr>
		</s:if>
    </tbody>
</table>

<div class="big-tb">
    <table class="tb" style="width: 100%;">
        <thead>
            <tr class="tb-line">
                <th class="tb-th" colspan="16">账号余额信息列表</th>
            </tr>
            <tr class="tb-line bg-gray">
            	<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
                <th class="tb-th">选择</th>
                </s:if>
                <th class="tb-th">机构号</th>
                <th class="tb-th">机构名称</th>
                <th class="tb-th">日期</th>
                <th class="tb-th">账号</th>                
                <th class="tb-th">账户余额</th>
                <th class="tb-th">状态</th>
                <th class="tb-th">最近代付日期</th>
                <th class="tb-th">最近代付时间</th>               
                <th class="tb-th">最近代付key_rsp</th>
                <th class="tb-th">最近代付金额</th>       
            </tr>
        </thead>
        <tbody>
			<s:iterator value="acctBalList" status="stat" id="bean">
				<tr  class="tb-line"  >
					<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
							<td class="tb-td" align="center">
                   			<input name="multiSel" value="<s:property value="#bean.currentDate"/>,<s:property value="#bean.orgCode"/>,<s:property value="#bean.account"/>" type="checkbox" />
                   			</td>
                	</s:if>
					<td class="tb-td">
						<s:property value="#bean.orgCode"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.orgCodeName"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.currentDate"/>
					</td>					
					<td class="tb-td">
						<s:property value="#bean.account"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.amt"/>
					</td>
					<td class="tb-td">
						<s:if test="#bean.status ==\"00\"">
						正常
						</s:if>
						<s:elseif test="#bean.status ==\"01\"">
						冻结
						</s:elseif>
					</td>
					<td class="tb-td">
						<s:property value="#bean.lastTransDt"/>
					</td>				
					<td class="tb-td">
						<s:property value="#bean.lastTransTm"/>
					</td>				
					<td class="tb-td">
						<s:property value="#bean.lastKeyRsp"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.lastTransAMT"/>
					</td>
				</tr>
			</s:iterator>
        </tbody>
    </table>
</div>
</s:form>
</body>
</html>